#include <sdk.h>
#include <wx/progdlg.h>
#include "sc_base_types.h"

class ProgressDialog : public wxProgressDialog {
  public:
    ProgressDialog() : wxProgressDialog( _T( "Progress" ), _T( "正在进行操作，请稍候..." ), 100, nullptr,
                                           wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT ) {
    }

    ~ProgressDialog() {
    }

    ProgressDialog& operator=( const ProgressDialog& ) {
      m_Throw( _T( "不应调用ProgressDialog复制构造函数!" ) );
    }

    bool DoUpdate( int value, const wxString& newmsg ) {
      return wxProgressDialog::Update( value, newmsg, nullptr );
    }
};

DECLARE_INSTANCE_TYPE( ProgressDialog );

namespace ScriptBindings {
  void Register_ProgressDialog() {
    SqPlus::SQClassDef<ProgressDialog>( "ProgressDialog" ).
    emptyCtor(). func( &ProgressDialog::DoUpdate, "DoUpdate" );
  }
}
